package zuk.clipvietfun.clipadapter.fragment;


import android.os.Handler;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;
import static zuk.clipvietfun.Const.*;
public class MPagerAdapter extends  FragmentPagerAdapter {
	static final String[] MENU = {
		"HOME",
		"HOT",
		"VUI",
		"SHOCK",
		"HÀI",
		"NHẠC TỔNG HỢP",
		"TV SHOW"};
	Handler settab;
	public MPagerAdapter(FragmentManager fm, Handler settab) {
		super(fm);
		this.settab = settab;
	}

	@Override
	public Fragment getItem(int position) {
		Fragment fragment = null;
		switch (position) {
		case 0:
			fragment = new FragmentHome(settab);
			break;
			
		case 1:
			fragment = new FragmentClip(CLIP_HOT);
			break;	
			
		case 2:
			fragment = new FragmentClip(CLIP_VUI);
			break;	
		
		case 3:
			fragment = new FragmentClip(CLIP_SHOCK);
			break;	
			
		case 4:
			fragment = new FragmentClip(CLIP_HAI);
			break;	
			
		case 5:
			fragment = new FragmentClip(CLIP_NHAC_TONG_HOP);
			break;	
			
		case 6:
			fragment = new FragmentClip(CLIP_TVSHOW);
			break;	
			
		}
		return fragment;
	}

	@Override
	public int getCount() {
		return MENU.length;
//		return 2;
	}

	@Override
	public CharSequence getPageTitle(int position) {
		String title = MENU[position];
		return title;
	}


}
